<template>
	<view class="head">
		<view class="img" @click="back">
			<image src="https://splendid.oss-cn-beijing.aliyuncs.com/static/zhengyulan/back-arrow.png" mode=""></image>
		</view>
		<view class="message">
			<text>更换记录</text>
		</view>
	</view>
	<view class="body">
		<view class="container">
			<view class="inp">
				<input type="text" name="" id="" v-model="sing"   placeholder="查询记录日期">
				<uni-datetime-picker v-model="single" @maskClick="maskClick" type="data" @change="dateChange">
				<image src="https://splendid.oss-cn-beijing.aliyuncs.com/static/zhengyulan/data.png" mode=""></image>
				</uni-datetime-picker>
			</view>
			<view class="heads">
				<view class="dj">
					<view class="imgsd">
						<view v-for="(item,index) in data" @click="chnage(index)"
							:class=" currindex == index ? 'active' : 'njuii' ">{{item.name}}</view>
					</view>
				</view>
			</view>
		</view>
	</view>

	<!-- rentong -->
	<scroll-view scroll-y="true" class="scroll-container">
	<view class="bods">
		<view class="container">
			<view class="xontent">
				<text class="hjuh">共有<text style="color: red;">20</text>个数据,&nbsp;最新记录有<text style="color: red;">2</text>条</text>
			</view>
			
			
			<view class="box" v-for="(item,index) in datas" @click="Changerecorddetails">
				<view class="heass">
				<view class="image">
					<image src="https://splendid.oss-cn-beijing.aliyuncs.com/static/zhengyulan/time.png" mode=""></image>
				</view>
				<view class="text">
				{{`更换时间:${item.Replacement}`}}
				</view>
				<view class="ghy">
					<image src="/static/xiala.png" mode=""></image>
				</view>
				</view>
				<view class="bottom">
					<view class="naem"><text>台账分类</text>:<text class="kki">{{item.Category}}</text> </view>
					<view class="pelpo"><text>活性炭批次号</text>:<text class="kki">{{item.Number}}</text> </view>
					<view class="address"><text>更换班次</text>:<text class="kki">{{item.Shift}}</text></view>
					<view class="liang"><text>活性炭用量</text>:<text class="kki">{{item.Chemical}}</text></view>
				</view>
			</view>
			
		</view>
	</view>
	</scroll-view>



</template>

<script setup>
	import {
		ref
	} from 'vue';

	var data = ref([{
		name: "全部"
	}, {
		name: "正常运行"
	}, {
		name: "异常运行"
	}])
	
	
	var datas = ref(
	[
	    {
	        "Replacement": "2025-06-16 08:00",
	        "Category": "班次对象",
	        "Number": "20250616",
	        "Shift": "白案(08:00-20:00)",
	        "Chemical": "1kg/L"
	    },
	    {
	        "Replacement": "2025-06-17 08:00",
			"Category": "班次对象",
	        "Number": "20250616",
	        "Shift": "白案(08:00-20:00)",
	        "Chemical": "1kg/L"
	    },
	    {
	        "Replacement": "2025-06-18 08:00",
			"Category": "班次对象",
	        "Number": "20250616",
	        "Shift": "白案(08:00-20:00)",
	        "Chemical": "1kg/L"
	    },
	    {
	        "Replacement": "2025-06-19 08:00",
	        "Number": "20250616",
			"Category": "班次对象",
	        "Shift": "白案(08:00-20:00)",
	        "Chemical": "1kg/L"
	    },
	    {
	        "Replacement": "2025-06-20 08:00",
	       "Number": "20250616",
		   "Category": "班次对象",
	       "Shift": "白案(08:00-20:00)",
	       "Chemical": "1kg/L"
	    },
	    {
	        "Replacement": "2025-06-21 08:00",
	        "Number": "20250616",
			"Category": "班次对象",
	        "Shift": "白案(08:00-20:00)",
	        "Chemical": "1kg/L"
	    }
	]
	
	
	
	)
	var currindex = ref(0)

	function chnage(e) {
		console.log(e);
		currindex.value = e
	}
	function Changerecorddetails () {
		uni.navigateTo({
			url:"/homePageOther/Changerecorddetails/Changerecorddetails"
		})
	}
	function back (){
		uni.navigateBack({
			delta:1
		})
	}
	function Operationrecords () {
		uni.navigateTo({
			url:"/homePageOther/Operationrecords/Operationrecords"
		})
	}
	var sing = ref('')
		function maskClick (){
			sing.value = ''
		}
		function dateChange (e){
			console.log(e);
			sing.value = e
		}
</script>

<style lang="scss" scoped>
	.head {
		width: 750rpx;
		height: 142rpx;
		background: #0874FA;
		position: relative;
		overflow: hidden;
	}

	.img {
		width: 22rpx;
		height: 38rpx;
		position: absolute;
		top: 75rpx;
		left: 40rpx;

		image {
			width: 22rpx;
			height: 38rpx;
		}
	}

	.message {
		width: 220rpx;
		height: 34rpx;
		font-family: Source Han Sans CN;
		font-weight: 500;
		font-size: 36rpx;
		color: #FFFFFF;
		line-height: 34rpx;
		position: absolute;
		top: 75rpx;
		left: 270rpx;

		text {
			display: inline-block;
			width: 220rpx;
			height: 34rpx;
			text-align: center;
			line-height: 34rpx;
		}
	}
.scroll-container {
  height: calc(100vh - 142rpx - 222rpx - 30rpx); /* 头部高度 + 搜索区域高度 + 间距 */
}
	.body {
		width: 100%;
		height: 100%;
		background-color: #f3f5f7;

		.container {
			width: 750rpx;
			height: 222rpx;
			background-color: #FFFFFF;
			overflow: hidden;
           
			.inp {
				width: 690rpx;
				height: 75rpx;
				background: #F7F7FE;
				border-radius: 38rpx;
				margin: 25rpx auto;
				color: #ABABBB;
				position: relative;
                display: flex;
                align-items: center;
                padding-left: 38rpx;
                input{
                	flex: 1;
                }
				

				image {
					width: 30rpx;
					height: 31rpx;
					position: absolute;
					top: 23rpx;
					right: 45rpx;
				}
			}
		}
	}

	.heads {
		width: 750rpx;
		// background-color: #ABABBB;
		position: relative;
	}

	.dj {
		width: 690rpx;
		height: 65rpx;
		// position: absolute;
		// left: 30rpx;
		margin:  0 auto;
	}

	.imgsd {
	width: 690rpx;
		height: 65rpx;
		font-family: Microsoft YaHei;
		font-size: 28rpx;
		color: #5F666E;
		display: flex;
		justify-content: space-between;
		align-items: center;
		overflow: hidden;
	}

	.njuii,
	.active {
		width: 123rpx;
		height: 65rpx;
		line-height: 65rpx;
		text-align: center;
		transition: all 0.3s ease;
	}

	.njuii {
		color: #5F666E;
	}

	.active {
		background: #DFEDFF;
		color: #0874FA;
		font-weight: bold;
		border-radius: 32rpx;
	}

	.bods{
		width: 100vw;
		height: 100vh;
		background: #F3F5F7;
		.container{
			width: 750rpx;
			position: relative;
			top: 30rpx;
		background: #F3F5F7;
			overflow: hidden;
				.xontent{
					width: 707rpx;
					height: 91rpx;
					background: #FFFFFF;
					border-radius: 14rpx;
					border: 1px solid #A7A7A7;
					margin: 0 auto;
					display: flex;
					align-items: center;
					// height: 23rpx;
					// margin-top: 25rpx;
					position: relative;
				// 	.vcgh{
				//    width: 707rpx;
				//    height: 91rpx;
				//    background: #FFFFFF;
				//    background-color: #0874FA;
				//    border-radius: 14rpx;
				//    border: 1px solid #A7A7A7;
				// 	 font-family: Source Han Sans CN;
				// 	 font-weight: 400;
				// 	 font-size: 23rpx;
				// 	 color: #333333;
				// 	 line-height: 23rpx;
				// 	 position: absolute;
				// 	 left: 45rpx;
				// 	 .two{
				// 		 margin-left: 30rpx;
				// 	 }
				// 	 .blue{
				// 		 color: #0874FA;
				// 	 }
				// 	 .blues{
				// 		 color: #0874FA;
				// 	 }
					
				// }	
				.hjuh{
					position: absolute;
					left: 24rpx;
				}
			}
		
		}
	}
	.box{
		width: 707rpx;
		height: 319rpx;
		border-radius: 14rpx;
		margin: 28rpx auto;
		background-color: #FFFFFF;
		overflow: hidden;
		.heass{
			width: 707rpx;
			height: 38rpx;
			margin-top: 30rpx;
			position: relative;
			.image{
				width: 38rpx;
				height: 38rpx;
				position: absolute;
				left: 36rpx;
				image{
					width: 38rpx;
					height: 38rpx;
				}
			}
			.text{
				
				height: 30rpx;
				font-family: Source Han Sans CN;
				font-weight: 500;
				font-size: 32rpx;
				color: #222222;
				line-height: 30rpx;
				position: absolute;
				left: 89rpx;
				top: 5rpx;
			}
			.ghy{
				width: 15rpx;
				height: 25rpx;
				position: absolute;
				left: 660rpx;
				image{
					width: 15rpx;
					height: 25rpx;
				}
			}
		}
		.bottom{
			width: 707rpx;
			height: 245rpx;
			position: relative;
			// background-color: red;
			.naem{
				// width: 210rpx;
				height: 24rpx;
				font-family: Source Han Sans CN;
				font-weight: 400;
				font-size: 26rpx;
				color: #666666;
				line-height: 24rpx;
				position: absolute;
				top: 40rpx;
				left: 42rpx;
			}
			.pelpo{
				height: 25rpx;
				font-family: Source Han Sans CN;
				font-weight: 400;
				font-size: 26rpx;
				color: #666666;
				line-height: 25rpx;
				position: absolute;
				top: 90rpx;
				left: 42rpx;
			}
			.address{
				height: 25rpx;
				font-family: Source Han Sans CN;
				font-weight: 400;
				font-size: 26rpx;
				color: #666666;
				line-height: 25rpx;
				position: absolute;
				top: 140rpx;
				left: 42rpx;
			}
			.liang{
				height: 25rpx;
				font-family: Source Han Sans CN;
				font-weight: 400;
				font-size: 26rpx;
				color: #666666;
				line-height: 25rpx;
				position: absolute;
				bottom: 29rpx;
				left: 42rpx;
			}
		}
	}
	.kki{
		margin-left: 17rpx;
	}
</style>